
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	
NOTE: the do-files 00_master_wage_imp, 01_split_episodes, 04_merge_basic_BHP, 
05_educ_broad, 06_wages_assessment_ceiling, 07_wages_marginal, 
08_wages_deflation, and 10_wages_imputation build on the do-files offered by 
Heiko Stüber, Wolfgang Dauth, Johann Eppelsheimer (see blow) but were slightly 
adjusted to run the code on our sample of the BeH.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/


cap log close
if(${logfile}==1) log using ${log}\08_wages_deflation.log, replace


/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	
	Deflate wages, marginal part-time income threshold and contribution assessment ceiling
	
	Consumer Price Index:
		Statistisches Bundesamt (2019)
		Preise - Verbraucherpreisindizes fuer Deutschland (Lange Reihe ab 1948)
		https://www.destatis.de/DE/Themen/Wirtschaft/Preise/Verbraucherpreisindex/_inhalt.html

	Generates the variables:
		- wage_defl: daily wage, deflated
		- limit_marginal_defl: marginal part-time income threshold, deflated
		- limit_assess_defl: contribution assessment ceiling, deflated
	
	
	Author(s): Wolfgang Dauth, Johann Eppelsheimer, Heiko Stüber
	
	Version: 1.0
	Created: 2022-11-24

	Note: 
	This do-file is part of the Stata do-file collection offered as a 
	supplement to Stüber, Dauth, and Eppelsheimer (2023): A Guide to Preparing 
	the Sample of Integrated Labour Market Biographies (SIAB, version 7519 v1) 
	for Scientific Analysis. Journal for Labour Market Research, 57:7.
	https://doi.org/10.1186/s12651-023-00335-w
	
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/


********************************************************************************
* Consumer Price Index West Germany 1975 - 1991 (base year 1995)
********************************************************************************
gen cpi=.
label variable cpi "Consumer Price Index"

replace cpi = 54.5 if jahr == 1975
replace cpi = 56.8 if jahr == 1976
replace cpi = 58.9 if jahr == 1977
replace cpi = 60.5 if jahr == 1978
replace cpi = 63.0 if jahr == 1979
replace cpi = 66.4 if jahr == 1980
replace cpi = 70.6 if jahr == 1981
replace cpi = 74.3 if jahr == 1982
replace cpi = 76.7 if jahr == 1983
replace cpi = 78.6 if jahr == 1984
replace cpi = 80.2 if jahr == 1985
replace cpi = 80.1 if jahr == 1986
replace cpi = 80.3 if jahr == 1987
replace cpi = 81.3 if jahr == 1988
replace cpi = 83.6 if jahr == 1989
replace cpi = 85.8 if jahr == 1990
replace cpi = 89.0 if jahr == 1991


********************************************************************************
* Set 2015 as base year for the period 1975 - 1991
********************************************************************************
replace cpi = (cpi/89.0)*65.5		// see Statistisches Bundesamt (2022)


********************************************************************************
* Consumer Price Index Germany (West and East, after 1991)
********************************************************************************
replace cpi =  68.8 if jahr == 1992
replace cpi =  71.9 if jahr == 1993
replace cpi =  73.8 if jahr == 1994
replace cpi =  75.1 if jahr == 1995
replace cpi =  76.1 if jahr == 1996
replace cpi =  77.6 if jahr == 1997
replace cpi =  78.3 if jahr == 1998
replace cpi =  78.8 if jahr == 1999
replace cpi =  79.9 if jahr == 2000
replace cpi =  81.5 if jahr == 2001
replace cpi =  82.6 if jahr == 2002
replace cpi =  83.5 if jahr == 2003
replace cpi =  84.9 if jahr == 2004
replace cpi =  86.2 if jahr == 2005
replace cpi =  87.6 if jahr == 2006
replace cpi =  89.6 if jahr == 2007
replace cpi =  91.9 if jahr == 2008
replace cpi =  92.2 if jahr == 2009
replace cpi =  93.2 if jahr == 2010
replace cpi =  95.2 if jahr == 2011
replace cpi =  97.1 if jahr == 2012
replace cpi =  98.5 if jahr == 2013
replace cpi =  99.5 if jahr == 2014
replace cpi = 100.0 if jahr == 2015
replace cpi = 100.5 if jahr == 2016
replace cpi = 102.0 if jahr == 2017
replace cpi = 103.8 if jahr == 2018
replace cpi = 105.3 if jahr == 2019

compress

drop begorig endorig beh_pers_gr beh_staat_dummy beh_beruf_num ausbildung_imp spell_length w93_3_gen
 

********************************************************************************
* Deflate wages, marginal part-time income threshold and contribution assessment ceiling (base year 2015)
********************************************************************************
gen wage_defl           = 100 * tentgelt / cpi
gen limit_marginal_defl = 100 * limit_marginal / cpi
gen limit_assess_defl   = 100 * limit_assess / cpi

label variable wage_defl "Daily wage, deflated (2015)"
label variable limit_marginal_defl "Marginal part-time income threshold, deflated (2015)"
label variable limit_assess_defl "Contribution assessment ceiling, deflated (2015)"

compress

cap log close

